Connect to monolith and sort out user auth spagetti #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR integrates with the monolith by @timcowlishaw.
The only view left is the map, together with the landing.
The following operations are now passed on to the monolith:
All the pages that could be stored somewhere (edit, profile, users) have a redirect to the monolith as well.
Solving auth spaghetti
In the current app (master) there is an spaghetti in the auth side. There is a bunch of places that request auth data (via stored token) before we actually check if the user is logged in. I fixed this by completely removing the use of localstorage/cookies for auth purposes, and I rely on the request to '/me' resolving. This presents an issue with CORS, that @timcowlishaw has resolved by whitelisting auth requests from our domain. In principle, it's fine, simplifies everything quite nicely (I think) but it'll require quite some testing before deploying.
Pending
Beyond the list above:
Discussion
Now we should discuss whether or not this makes sense or not. Besides the minor issue with CORS, which seems fine, there is a potential issue in that we are touching integral parts of the web, and that it probably makes more sense to transition the map over to the monolith. I think this PR could be there, but I believe that with a bit more of work, we could potentially deprecate this app, and move it all to a more stable stack.
Please, take a look and test, and provide feedback on the different points from above.